<?php
/**
 * Safitech Extension
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * @category   Safitech
 * @package    Safitech_Catalog
 * @author     S. Mohammed Alsharaf
 * @copyright  Copyright (c) 2009 Safi Technologies Ltd. (http://www.safitech.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

/**
 * Product media data template
 *
 * @see Mage_Catalog_Block_Product_View_Media
 */
?>
<?php $_product = $this->getProduct() ?>
<?php if ($_product->getImage() != 'no_selection' && $_product->getImage() ): ?>
<script type="text/javascript">
//<![CDATA[
jQuery.noConflict();
function jSelectImage(url) {
	jQuery("#image a").css("z-index","-1").hide();
	jQuery("#image"+url).css("z-index","100").show();
}
(function($) { 
	$j(function() {
	jQuery("#image0").css("z-index","100");
    $j(".jqzoom").jqzoom({
		zoomWidth: <?php echo Mage::getStoreConfig('safitech_jqzoom/general/popup_width'); ?>,		
		zoomHeight: <?php echo Mage::getStoreConfig('safitech_jqzoom/general/popup_height'); ?>
	});
  });
})(jQuery);
//]]>
</script>
	<div id="image" class="product-image product-image-zoom">
		<a  id="main_image_a" href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" class="jqzoom product-image product-image-zoom" style="" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
		<img id="main_image" src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(272,347); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" />
		</a>
	</div>
	<p class="zoom-notice" id="track_hint"><?php echo $this->__('Click on above image to view full picture') ?></p>
<?php else: ?>
	<a href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" class="jqzoom product-image product-image-zoom" style="" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
	<img id="image" src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(400,300); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" />
	</a>
<?php endif; ?>

<?php if (count($this->getGalleryImages()) > 0): ?>
<div class="more-views">
    <h2><?php echo $this->__('More Views') ?></h2>
    <ul>
    <?php foreach ($this->getGalleryImages() as $_image): ?>
        <li>
            <a href="#" onclick="choose_zoom_image("<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(290,436); ?>","<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile()); ?>")"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
        </li>
    <?php endforeach; ?>
    </ul>
</div>
<?php endif; ?>



